package com.babble.manage.feign;

import com.babble.manage.entity.Img;
import com.babble.manage.service.IImgService;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 图片客户端
 *
 * @author wm
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("img-feign")
@Api(value = "图片模块(Feign)", tags = "图片模块客户端")
public class ImgClient implements IImgClient {
	private final IImgService imgService;

	@Override
	@GetMapping("get/{id}")
	@ApiOperation(value = "获取图片", notes = "通过id获取图片信息")
	@ApiOperationSupport(order = 1)
	public R<Img> getImg(@PathVariable("id") String id) {
		return R.data(imgService.getById(id));
	}
}
